FROM python:3.10-slim

WORKDIR /app

COPY requirements-Linux.txt requirements.txt


# 安装系统依赖（包括pkg-config和MySQL客户端开发库）
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    pkg-config \
    default-libmysqlclient-dev \
    gcc \
    && rm -rf /var/lib/apt/lists/*

RUN pip install --upgrade pip
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir --retries 10 --timeout 60  \
    -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt

COPY . .

EXPOSE 8080

ENV FLASK_APP=run.py

CMD ["python","run.py"]
